//
//  UIView+WFUtils.m
//  WisdomFarm
//
//  Created by sky on 2018/2/27.
//  Copyright © 2018年 sky. All rights reserved.
//

#import "UIView+WFUtils.h"

@implementation UIView (WFUtils)

- (UIImage *)wf_snapshotImage
{
    UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, 0);
    if (![self drawViewHierarchyInRect:self.bounds
                    afterScreenUpdates:YES]) {
        [self.layer renderInContext:UIGraphicsGetCurrentContext()];
    }
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return image;
}

@end
